//
//  main.cpp
//  CAP3 3.3
//
//  Created by 孙洋洋 on 2022/4/9.
//  Copyright © 2022 当狗的二象性. All rights reserved.
//
//输入字符串，统计a和i的个数，并输出字符串
#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
    char ch[80];
    int i=0;
    int an=0;
    int in=0;
    cout<<"请输入字符串：";
    cin>>ch;
    while (ch[i]!='\0')
    {
        if (ch[i]=='a')
        {
            an=an+1;
        }
        if (ch[i]=='i')
        {
            in=in+1;
        }
        i++;
    }
    cout<<"字符串为"<<ch<<endl;
    cout<<"a number ="<<an<<endl;
    cout<<"i number ="<<in<<endl;
    
}
